//package com.aliyun.mgt;
//
//import com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect;
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
//import org.springframework.beans.BeansException;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.ApplicationContextAware;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.stereotype.Component;
//
///**
// * Test 配置基类
// * - Mock
// */
//@Component
//@Configuration
//public class BaseConfig implements ApplicationContextAware {
//    // 故障注入测试FIT(Fault Injection Test): timeout, exception, failure
//
//    //模拟外部接口抛出异常
//    protected static final String FIT_TYPE_TIMEOUT = "timeout";
//
//    //模拟外部接口调用超时
//    protected static final String FIT_TYPE_EXCEPTION = "exception";
//
//    //模拟外部接口调用返回业务失败
//    protected static final String FIT_TYPE_FAILURE = "failure";
//
//    protected final Log logger = LogFactory.getLog(this.getClass());
//
//    @Value("${bpaas.test.fault.inject.enabled:false}")
//    protected boolean fitEnabled;
//    @Value("${bpaas.test.fault.inject.type:timeout}")
//    protected String fitType;
//
//    protected void mockIt(ApplicationContext applicationContext) {
//        logger.warn("todo-mockIt");
//    }
//
//    @Override
//    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//        mockIt(applicationContext);
//    }
//
//    @Bean
//    @ConditionalOnMissingBean
//    public HystrixCommandAspect hystrixAspect() {
//        return new HystrixCommandAspect();
//    }
//}
